import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '任务名称',
    align: "center",
    dataIndex: 'taskName'
  },
  {
    title: '角色',
    align: "center",
    dataIndex: 'role'
  },

  {
    title: '任务进度',
    align: "center",
    dataIndex: 'progress'
  },
  {
    title: '工作量占比',
    align: "center",
    dataIndex: 'workloadRatio'
  },
  {
    title: '任务状态',
    align: "center",
    dataIndex: 'status_dictText'
  },
  {
    title: '计划开始时间',
    align: "center",
    dataIndex: 'startTime',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },
  {
    title: '计划结束时间',
    align: "center",
    dataIndex: 'endTime',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },
  {
    title: '创建时间',
    align: "center",
    dataIndex: 'createdTime',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },
  {
    title: '服务内容',
    align: "center",
    dataIndex: 'serviceContent',
    width: 120,
    slots: { customRender: 'htmlSlot' }
  },
];

// 高级查询数据
export const superQuerySchema = {
  taskName: {title: '任务名称',order: 0,view: 'text', type: 'string',},
  role: {title: '角色',order: 1,view: 'text', type: 'string',},
  startTime: {title: '计划开始时间',order: 2,view: 'date', type: 'string',},
  endTime: {title: '计划结束时间',order: 3,view: 'date', type: 'string',},
  progress: {title: '任务进度（0-100）',order: 4,view: 'number', type: 'number',},
  workloadRatio: {title: '工作量占比',order: 5,view: 'number', type: 'number',},
  status: {title: '任务状态',order: 6,view: 'number', type: 'number',dictCode: 'service_task_status',},
  createdTime: {title: '创建时间',order: 7,view: 'date', type: 'string',},
  serviceContent: {title: '服务内容',order: 8,view: 'text', type: 'string',},
};
